home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / MultiSession 1.04 Source / Core 27⁄June⁄1993 / CStaticText.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-04  |  1.5 KB  |  64 lines  |  [TEXT/KAHL]

  1. /* CStaticText.c */
  2.  
  3. #include "CStaticText.h"
  4. #include "CWindow.h"
  5. #include "Memory.h"
  6.  
  7.  
  8. /* */        CStaticText::~CStaticText()
  9.     {
  10.         ERROR(Initialized != True,PRERR(ForceAbort,
  11.             "CStaticText::~CStaticText called on uninitialized object."));
  12.         ReleaseHandle(Text);
  13.     }
  14.  
  15.  
  16. void        CStaticText::IStaticText(LongPoint Start, LongPoint Extent, Handle DaText,
  17.                     short TheFontID, short ThePointSize, CWindow* TheWindow,
  18.                     CEnclosure* TheEnclosure, short TheJustification)
  19.     {
  20.         ERROR(Initialized == True,PRERR(ForceAbort,
  21.             "CStaticText::IStaticText called on already initialized object."));
  22.         EXECUTE(Initialized = True);
  23.         Text = DaText;
  24.         ERROR(DaText==NIL,PRERR(ForceAbort,"CStaticText::IStaticText passed NIL for text."));
  25.         FontID = TheFontID;
  26.         PointSize = ThePointSize;
  27.         Justification = TheJustification;
  28.         IViewRect(Start,Extent,TheWindow,TheEnclosure);
  29.     }
  30.  
  31.  
  32. void        CStaticText::DoUpdate(void)
  33.     {
  34.         ERROR(Initialized != True,PRERR(ForceAbort,
  35.             "CStaticText::DoUpdate called on uninitialized object."));
  36.         SetUpPort();
  37.         Window->ResetPen();
  38.         Window->SetText(FontID,0,srcOr,PointSize,0);
  39.         if (!Enabled)
  40.             {
  41.                 Window->SetGreyishTextOr();
  42.             }
  43.         ERROR(Text==NIL,PRERR(ForceAbort,"CStaticText::DoUpdate Text handle is NIL."));
  44.         HLock(Text);
  45.         Window->LTextBox(ZeroPoint,Extent,Text,Justification);
  46.         HUnlock(Text);
  47.     }
  48.  
  49.  
  50. void        CStaticText::DoDisable(void)
  51.     {
  52.         inherited::DoDisable();
  53.         SetUpPort();
  54.         Window->InvalidateLong(ZeroPoint,Extent);
  55.     }
  56.  
  57.  
  58. void        CStaticText::DoEnable(void)
  59.     {
  60.         inherited::DoEnable();
  61.         SetUpPort();
  62.         Window->InvalidateLong(ZeroPoint,Extent);
  63.     }
  64.